package designPattern.singletonPattern;

import java.io.Serializable;

/**
 * SerSerSingleton
 *
 * @author nanxin.chen
 * @date 2015/11/3
 */
public class SerSingleton implements Serializable{
    private static SerSingleton singleton = new SerSingleton();

    private SerSingleton() {
        System.out.println("create a singleton instance.");
    }

    public static SerSingleton getInstance() {
        return singleton;
    }

    private Object readResolve() {
        return singleton;
    }
}
